{include file="public/header" /}
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body ">
                    <fieldset id="searchFieldset_currentTableRenderId" class="table-search-fieldset">
                        <legend>条件搜索</legend>
                        <form class="layui-form layui-form-pane form-search">
                            <div class="layui-form-item layui-inline">
                                <label class="layui-form-label">搜索</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="title" placeholder="收货人名称/电话/地址关键字信息"
                                        value="{:input('get.title')}" autocomplete="off" class="layui-input">
                                </div>
                                <input type="hidden" name="id" value="{:input('get.id')}">
                            </div>
                            <div class="layui-form-item layui-inline">
                                <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="sreach">搜索</button>
                            </div>
                        </form>
                    </fieldset>
                </div>
                <div class="layui-card-header">
                    <button class="layui-btn layui-btn-sm layui-btn-danger"
                        onclick="delAll('/user/address_del')">删除</button>
                    <a title="添加" onclick="open_add('添加','/user/address_edit?user_id={:input('get.id')}')"
                        href="javascript:;" class="layui-btn layui-btn-sm">
                        添加
                    </a> 数据：<strong id="count">{$list->total()}</strong> 条
                </div>
                <div class="layui-card-body layui-table-body layui-table-main">
                    <table class="layui-table layui-form">
                        <thead>
                            <tr>
                                <th>
                                    <input type="checkbox" lay-filter="checkall" name="" lay-skin="primary">
                                </th>
                                <th>
                                    <div class="layui-table-cell">ID</div>
                                </th>
                                <th>
                                    <div class="layui-table-cell">名称</div>
                                </th>
                                <th>
                                    <div class="layui-table-cell">电话</div>
                                </th>
                                <th>
                                    <div class="layui-table-cell">地址信息</div>
                                </th>
                                <th>
                                    <div class="layui-table-cell">操作</div>
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            {foreach $list as $v}
                            <tr>
                                <td>
                                    <input type="checkbox" name="id" value="{$v.id|default='0'}" lay-skin="primary">
                                </td>
                                <td>
                                    <div class="layui-table-cell">{$v.id|default=''}</div>
                                </td>
                                <td>
                                    <div class="layui-table-cell">{$v.name|default='--'}</div>
                                </td>
                                <td>
                                    <div class="layui-table-cell">{$v.mobile|default='未添加'}</div>
                                </td>
                                <td>
                                    <div class="layui-table-cell">{$v.province}{$v.city}{$v.area}{$v.address}</div>
                                </td>
                                <td class="layui-table-col-special">
                                    <div class="layui-table-cell">
                                        <a title="编辑"
                                            onclick="open_add('编辑','/user/address_edit?id={$v.id}&user_id={:input('get.id')}')"
                                            href="javascript:;" class="layui-btn layui-btn-sm">
                                            编辑
                                        </a>
                                        <a title="删除" onclick="open_dels(this,'/user/address_del','{$v.id}')"
                                            href="javascript:;" class="layui-btn-danger layui-btn layui-btn-sm">
                                            删除
                                        </a>
                                    </div>
                                </td>
                            </tr>
                            {/foreach}
                        </tbody>
                    </table>
                </div>
                <div class="layui-card-body">
                    <div class="page">
                        {$list->render()|raw}
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
{include file="public/footer"}
<script>
    layui.use(['laydate', 'form'], function () {
        var laydate = layui.laydate;
        var form = layui.form;
        // 监听全选
        form.on('checkbox(checkall)', function (data) {

            if (data.elem.checked) {
                $('tbody input').prop('checked', true);
            } else {
                $('tbody input').prop('checked', false);
            }
            form.render('checkbox');
        });
        //执行一个laydate实例
        laydate.render({
            elem: '#start' //指定元素
        });
        //执行一个laydate实例
        laydate.render({
            elem: '#end' //指定元素
        });
    });

</script>

</html>